package edu.sctu.zhengsenwen.month201506.day20150624;

/**
 * 短整型整数类
 * Created by user15 on 2015/6/24.
 */
public class ShortDemo {

    public static void main(String[] args) {

        Short s1 = 2253;
        Short short1 = new Short(s1);
        Short short2 = new Short("2255");
        System.out.println("short1 = "+ short1.toString());
        System.out.println("short2 = "+ short2.toString());

        System.out.println("Short.MAX_VALUE = "+ Short.MAX_VALUE);
        System.out.println("Short.MIN_VALUE = "+ Short.MIN_VALUE);
        System.out.println("Short.TYPE = "+Short.TYPE);

        byte b1 = short1.byteValue();
        int i1 = short1.intValue();
        long l1 = short1.longValue();
        float f1 = short1.floatValue();
        double d1 = short1.doubleValue();
        System.out.println("short1.compareTo(short2) = "+ short1.compareTo(short2));
        short1 = Short.decode("551");
        System.out.println("short1.toString() = "+ short1.toString());
        System.out.println("Short.parseShort(\"11100\",2) = "+
                Short.parseShort("11100",2));
        System.out.println("Short.parseShort(\"100,16\") = "+
                Short.parseShort("100",16));


    }
}
